package com.kinyx.framework.business;

import org.junit.Assert;
import org.junit.Test;

public class KHexUtils_Tester_char2int {

	@Test
	public void test() {
		Assert.assertTrue(KHexUtils.char2int('0') == 0);
		Assert.assertTrue(KHexUtils.char2int('1') == 1);
		Assert.assertTrue(KHexUtils.char2int('2') == 2);
		Assert.assertTrue(KHexUtils.char2int('3') == 3);
		Assert.assertTrue(KHexUtils.char2int('4') == 4);
		Assert.assertTrue(KHexUtils.char2int('5') == 5);
		Assert.assertTrue(KHexUtils.char2int('6') == 6);
		Assert.assertTrue(KHexUtils.char2int('7') == 7);
		Assert.assertTrue(KHexUtils.char2int('8') == 8);
		Assert.assertTrue(KHexUtils.char2int('9') == 9);

		Assert.assertTrue(KHexUtils.char2int('a') == 10);
		Assert.assertTrue(KHexUtils.char2int('b') == 11);
		Assert.assertTrue(KHexUtils.char2int('c') == 12);
		Assert.assertTrue(KHexUtils.char2int('d') == 13);
		Assert.assertTrue(KHexUtils.char2int('e') == 14);
		Assert.assertTrue(KHexUtils.char2int('f') == 15);

		Assert.assertTrue(KHexUtils.char2int('A') == 10);
		Assert.assertTrue(KHexUtils.char2int('B') == 11);
		Assert.assertTrue(KHexUtils.char2int('C') == 12);
		Assert.assertTrue(KHexUtils.char2int('D') == 13);
		Assert.assertTrue(KHexUtils.char2int('E') == 14);
		Assert.assertTrue(KHexUtils.char2int('F') == 15);

		Assert.assertThrows(IllegalArgumentException.class, () -> Assert.assertTrue(KHexUtils.char2int('G') == 15));
	}

}
